package com.young.eventcoach.coach;

import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.util.ArrayList;

import org.xml.sax.Attributes;
import org.xml.sax.SAXException;

import android.util.Log;

import com.young.eventcoach.board.ReplyItemData;
import com.young.eventcoach.parser.SaxParserHandler;
import com.young.eventcoach.parser.SaxResultParser;

public class CoachResultItems implements SaxParserHandler{
	public String result;
	public ArrayList<CoachResultItemData> items = new ArrayList<CoachResultItemData>();
	
	@Override
	public String getTagName() {
		// TODO Auto-generated method stub
		return "channel";
	}
	
	@Override
	public void parseStartElement(String tagName, Attributes attributes,
			String namespaceUri, String qualifiedName, SaxResultParser parser)
			throws SAXException {
		if (tagName.equalsIgnoreCase("item")) {
			CoachResultItemData item = new CoachResultItemData();
			parser.pushHandler(item);
		}
	}
	@Override
	public void parseEndElement(String tagName, Object content,
			String namespaceUri, String qualifiedName, SaxResultParser parser)
			throws SAXException {
		if (tagName.equalsIgnoreCase("result")) {
			this.result = (String)content;
		} else if (tagName.equalsIgnoreCase("item")) {
			this.items.add((CoachResultItemData)content);
		}
	}
	@Override
	public Object getParseResult() {
		return this;
	}

	
	
	
}
